let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n137,
                    i =
                    (this && this.__extends) ||
                    ((_n137 = function n(t, e) {
                            return (_n137 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n137(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        }),
                    r =
                    (this && this.__decorate) ||
                    function(t, e, o, n) {
                        var i,
                            r = arguments.length,
                            a =
                            r < 3 ?
                            e :
                            null === n ?
                            (n = Object.getOwnPropertyDescriptor(e, o)) :
                            n;
                        if (
                            'object' ==
                            (typeof Reflect === 'undefined' ?
                                'undefined' :
                                typeof(Reflect)) &&
                            'function' == typeof Reflect.decorate
                        )
                            a = Reflect.decorate(t, e, o, n);
                        else
                            for (var s = t.length - 1; s >= 0; s--) {
                                (i = t[s]) &&
                                (a = (r < 3 ? i(a) : r > 3 ? i(e, o, a) : i(e, o)) || a);
                            }
                        return r > 3 && a && Object.defineProperty(e, o, a), a;
                    };
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.PlayerMrg = void 0);
                var a = t('AbsInfo'),
                    s = t('ChapterCfg'),
                    c = t('ChapterRoundCfg'),
                    l = t('TimeMrg'),
                    u = t('AbsObject'),
                    h = t('UIMrg'),
                    p = t('GuidePanel'),
                    f = t('ConstantCfg'),
                    d = t('NumValue'),
                    g = t('DateTimeUtils'),
                    _ = t('WeakGuidePanel'),
                    y = cc._decorator,
                    C = y.ccclass,
                    m =
                    (y.property,
                        (function(t) {
                            function e() {
                                var e = t.call(this) || this;
                                return (
                                    (e._power = new d.default(90)),
                                    (e._powerRecoverTime = 0),
                                    (e._fbLevelLimit = 9999),
                                    (e._chapter = s.ChapterCfg.ins.getData(1)),
                                    (e._round = c.ChapterRoundCfg.ins.getDataByChapter(
                                        e._chapter.id
                                    )[0]),
                                    (e.chapterAwards = {}),
                                    (e._guides = {}),
                                    (e._sweep = new d.default(f.ConstantCfg.ins.getValue(7))),
                                    (e._moneyBuyPower = new d.default(
                                        f.ConstantCfg.ins.getValue(8)
                                    )),
                                    (e._adBuyPower = new d.default(
                                        f.ConstantCfg.ins.getValue(9)
                                    )),
                                    (e._gainBuffs = {}),
                                    e.resetFbTime(),
                                    e
                                );
                            }
                            var o;
                            return (
                                i(e, t),
                                (o = e),
                                Object.defineProperty(e, 'ins', {
                                    get: function get() {
                                        return null == o._ins && (o._ins = new o()), this._ins;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.resetFbTime = function() {
                                    this._fbTime = {};
                                    for (
                                        var t = s.ChapterCfg.ins.getFbChapter(), e = 0; e < t.length; e++
                                    ) {
                                        var o = t[e];
                                        (this._fbLevelLimit = Math.min(
                                            this._fbLevelLimit,
                                            o.chapterLimit
                                        )),
                                        (this._fbTime[o.id] = o.times);
                                    }
                                }),
                                (e.prototype.getFbTotalTime = function() {
                                    for (
                                        var t = s.ChapterCfg.ins.getFbChapter(), e = 0, o = 0; o < t.length; o++
                                    ) {
                                        var n = t[o],
                                            i = this._fbTime[n.id];
                                        i && (e += i);
                                    }
                                    return e;
                                }),
                                Object.defineProperty(e.prototype, 'fbLevelLimit', {
                                    get: function get() {
                                        return this._fbLevelLimit;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.init = function(t) {
                                    t &&
                                        (null != t.power && (this._power.value = t.power),
                                            t.powerRecoverTime && this.calcuPower(t.powerRecoverTime),
                                            null != t.chapter &&
                                            ((this._chapter = s.ChapterCfg.ins.getData(t.chapter)),
                                                (this._round = c.ChapterRoundCfg.ins.getDataByChapter(
                                                    this._chapter.id
                                                )[0])),
                                            null != t.maxRound &&
                                            (this._maxRound = c.ChapterRoundCfg.ins.getData(
                                                t.maxRound
                                            )),
                                            null != t.chapterAwards &&
                                            (this.chapterAwards = t.chapterAwards),
                                            null != t.chapterAwards &&
                                            (this.chapterAwards = t.chapterAwards),
                                            null != t.guides && (this._guides = t.guides),
                                            null != t.sweep && (this._sweep.value = t.sweep),
                                            null != t.moneyBuyPower &&
                                            (this._moneyBuyPower.value = t.moneyBuyPower),
                                            null != t.adBuyPower &&
                                            (this._adBuyPower.value = t.adBuyPower),
                                            null != t.fbTime && (this._fbTime = t.fbTime),
                                            null != t.gainBuffs && (this._gainBuffs = t.gainBuffs)),
                                        this.emit(a.InfoEvent.CountChanged),
                                        this.emit(a.InfoEvent.AwardChanged),
                                        this.emit(a.InfoEvent.RoundChanged),
                                        this.emit(a.InfoEvent.PowerChanged),
                                        this.checkRedDotState();
                                }),
                                (e.prototype.calcuPower = function(t) {
                                    var e = f.ConstantCfg.ins.getValue(2);
                                    if (this._power.value < e) {
                                        var o = l.TimeMrg.serverTime - t;
                                        if (o > 0) {
                                            var n =
                                                f.ConstantCfg.ins.getValue(3, 0) *
                                                g.DateTimeUtils.Second2Millisecond,
                                                i = f.ConstantCfg.ins.getValue(3, 1),
                                                r = Math.floor(o / n);
                                            this._power.value + r * i < e ?
                                                ((this._powerRecoverTime =
                                                        l.TimeMrg.serverTime + (o - n * r)),
                                                    this._powerRecoverTime > l.TimeMrg.serverTime &&
                                                    (l.TimeMrg.timer.removeTarget(this),
                                                        l.TimeMrg.timer.delayCall(
                                                            this.onAutoAddPowerHandler,
                                                            this,
                                                            (this._powerRecoverTime - l.TimeMrg.serverTime) /
                                                            g.DateTimeUtils.Second2Millisecond
                                                        )),
                                                    (this._power.value += i * r)) :
                                                (this._power.value = e);
                                        } else
                                            (this._powerRecoverTime = t),
                                            l.TimeMrg.timer.removeTarget(this),
                                            l.TimeMrg.timer.delayCall(
                                                this.onAutoAddPowerHandler,
                                                this,
                                                (this._powerRecoverTime - l.TimeMrg.serverTime) /
                                                g.DateTimeUtils.Second2Millisecond
                                            );
                                    }
                                }),
                                Object.defineProperty(e.prototype, 'powerRecoverTime', {
                                    get: function get() {
                                        return this._powerRecoverTime;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.onAutoAddPowerHandler = function() {
                                    this.power += f.ConstantCfg.ins.getValues(3)[1];
                                }),
                                (e.prototype.getData = function() {
                                    var t = {};
                                    return (
                                        (t.power = this.power),
                                        (t.powerRecoverTime = this.powerRecoverTime),
                                        (t.chapter = this.chapter.id),
                                        this._maxRound ?
                                        (t.maxRound = this._maxRound.id) :
                                        (t.maxRound = 0),
                                        (t.chapterAwards = this.chapterAwards),
                                        (t.sweep = this._sweep.value),
                                        (t.guides = this._guides),
                                        (t.moneyBuyPower = this._moneyBuyPower.value),
                                        (t.adBuyPower = this._adBuyPower.value),
                                        (t.fbTime = this._fbTime),
                                        (t.gainBuffs = this._gainBuffs),
                                        t
                                    );
                                }),
                                (e.prototype.gainBuff = function(t) {
                                    this._gainBuffs[t] ||
                                        ((this._gainBuffs[t] = !0),
                                            this.emit(a.InfoEvent.BuffChanged));
                                }),
                                (e.prototype.isNewBuff = function(t) {
                                    return 1 != this._gainBuffs[t];
                                }),
                                Object.defineProperty(e.prototype, 'gainBuffs', {
                                    get: function get() {
                                        return this._gainBuffs;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.setBind = function(t) {
                                    (this._bind = t),
                                    this._bind.setRedDotState(this._redDotState);
                                }),
                                (e.prototype.checkRedDotState = function() {
                                    var t = !1;
                                    if (this.maxRound)
                                        for (
                                            var e = 0; e < c.ChapterRoundCfg.ins.list.length; e++
                                        ) {
                                            var o = c.ChapterRoundCfg.ins.list[e];
                                            if (
                                                o.id <= this.maxRound.id &&
                                                o.box.length > 0 &&
                                                !this.getChapterAwardState(o.id)
                                            ) {
                                                t = !0;
                                                break;
                                            }
                                        }
                                    t || (this._chapter.id > 1 && (t = this.sweepCount > 0)),
                                        t != this._redDotState &&
                                        ((this._redDotState = t),
                                            this._bind && this._bind.setRedDotState(t));
                                }),
                                (e.prototype.checkChapterRedDotState = function(t) {
                                    if (this.maxRound) {
                                        var e = c.ChapterRoundCfg.ins.getDataByChapter(t);
                                        if (e)
                                            for (var o = 0; o < e.length; o++) {
                                                var n = e[o];
                                                if (
                                                    n.id <= this.maxRound.id &&
                                                    n.box.length > 0 &&
                                                    !this.getChapterAwardState(n.id)
                                                )
                                                    return !0;
                                            }
                                    }
                                    return !1;
                                }),
                                (e.prototype.showGuide = function(t) {
                                    this.hasGuide(t) &&
                                        (1 == t || 5 == t || 7 == t ?
                                            h.UIMrg.show(p.GuidePanel, t) :
                                            h.UIMrg.show(_.WeakGuidePanel, t));
                                }),
                                (e.prototype.guideComplete = function(t) {
                                    this._guides[t] || (this._guides[t] = 1);
                                }),
                                (e.prototype.hasGuide = function(t) {
                                    return !this._guides[t];
                                }),
                                Object.defineProperty(e.prototype, 'sweepCount', {
                                    get: function get() {
                                        return this._sweep.value;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.sweepChapter = function() {
                                    return (
                                        this._sweep.value > 0 &&
                                        (this._sweep.value--,
                                            this.emit(a.InfoEvent.CountChanged),
                                            this.checkRedDotState(),
                                            !0)
                                    );
                                }),
                                (e.prototype.receiveChapterAward = function(t) {
                                    this._maxRound &&
                                        t <= this._maxRound.id &&
                                        (this.chapterAwards[t] ||
                                            ((this.chapterAwards[t] = !0),
                                                this.checkRedDotState(),
                                                this.emit(a.InfoEvent.AwardChanged)));
                                }),
                                (e.prototype.getChapterAwardState = function(t) {
                                    return this.chapterAwards[t];
                                }),
                                Object.defineProperty(e.prototype, 'power', {
                                    get: function get() {
                                        return this._power.value;
                                    },
                                    set: function set(t) {
                                        var e = f.ConstantCfg.ins.getValue(2),
                                            o = Math.max(t, 0);
                                        this._power.value != o &&
                                            ((this._power.value = o),
                                                o < e ?
                                                this._powerRecoverTime <=
                                                l.TimeMrg.serverTime + 1e3 &&
                                                ((this._powerRecoverTime =
                                                        l.TimeMrg.serverTime +
                                                        f.ConstantCfg.ins.getValue(3, 0) *
                                                        g.DateTimeUtils.Second2Millisecond),
                                                    l.TimeMrg.timer.delayCall(
                                                        this.onAutoAddPowerHandler,
                                                        this,
                                                        f.ConstantCfg.ins.getValue(3, 0)
                                                    )) :
                                                ((this._powerRecoverTime = l.TimeMrg.serverTime),
                                                    l.TimeMrg.timer.removeTarget(this)),
                                                this.checkRedDotState(),
                                                this.emit(a.InfoEvent.PropertyChanged));
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                Object.defineProperty(e.prototype, 'chapter', {
                                    get: function get() {
                                        return this._chapter;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                Object.defineProperty(e.prototype, 'round', {
                                    get: function get() {
                                        return this._round;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                Object.defineProperty(e.prototype, 'maxRound', {
                                    get: function get() {
                                        return this._maxRound;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.enterFb = function(t) {
                                    var e = this._fbTime[t];
                                    return (
                                        e > 0 &&
                                        ((this._fbTime[t] = e - 1),
                                            this.emit(a.InfoEvent.TimeChanged),
                                            !0)
                                    );
                                }),
                                (e.prototype.getFbTime = function(t) {
                                    var e = this._fbTime[t];
                                    return e > 0 ? e : 0;
                                }),
                                (e.prototype.nextChapter = function() {
                                    var t = s.ChapterCfg.ins.getData(this._chapter.id + 1);
                                    t &&
                                        ((this._chapter = t),
                                            (this._round = c.ChapterRoundCfg.ins.getDataByRound(
                                                this._chapter.id,
                                                1
                                            )),
                                            this.checkRedDotState(),
                                            this.emit(a.InfoEvent.ChapterChanged));
                                }),
                                (e.prototype.firstRound = function() {
                                    this._round = c.ChapterRoundCfg.ins.getDataByRound(
                                        this._chapter.id,
                                        1
                                    );
                                }),
                                (e.prototype.nextRound = function(t, e) {
                                    return (
                                        void 0 === e && (e = 1),
                                        !!t &&
                                        (1 == e &&
                                            (null == this.maxRound ||
                                                (this.maxRound && t.id > this.maxRound.id)) &&
                                            ((this._maxRound = t),
                                                this.checkRedDotState(),
                                                this.emit(a.InfoEvent.AwardChanged)),
                                            (this._round = t),
                                            !0)
                                    );
                                }),
                                (e.prototype.moneyBuyPower = function() {
                                    this._moneyBuyPower.value > 0 &&
                                        (this._moneyBuyPower.value--,
                                            this.emit(a.InfoEvent.CountChanged));
                                }),
                                (e.prototype.adBuyPower = function() {
                                    this._adBuyPower.value > 0 &&
                                        (this._adBuyPower.value--,
                                            this.emit(a.InfoEvent.CountChanged));
                                }),
                                Object.defineProperty(e.prototype, 'moneyBuyPowerCount', {
                                    get: function get() {
                                        return this._moneyBuyPower.value;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                Object.defineProperty(e.prototype, 'adBuyPowerCount', {
                                    get: function get() {
                                        return this._adBuyPower.value;
                                    },
                                    enumerable: !1,
                                    configurable: !0
                                }),
                                (e.prototype.newDay = function() {
                                    var t = f.ConstantCfg.ins.getValue(2);
                                    this.power < t && (this.power = t),
                                        (this._sweep.value = f.ConstantCfg.ins.getValue(7)),
                                        (this._moneyBuyPower.value = f.ConstantCfg.ins.getValue(8)),
                                        (this._adBuyPower.value = f.ConstantCfg.ins.getValue(9)),
                                        this.resetFbTime(),
                                        this.checkRedDotState(),
                                        this.emit(a.InfoEvent.CountChanged),
                                        this.emit(a.InfoEvent.TimeChanged);
                                }),
                                (o = r([C('PlayerMrg')], e))
                            );
                        })(u.AbsObject));
                (o.PlayerMrg = m), console.log("end");
            module.exports =  e.exports;